<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    

    <div id="app">
        <input type="text" v-model="message">
        <h1>{{message | filterA}}</h1>
        <hr>
        <input type="text" v-model="num">
        <h1>{{num | filterB}}</h1>
    </div>


    <script type="text/javascript">
        var vm =new Vue({
            el: '#app',
            data: {
                message:'',
                num:0
            },
            filters:{
                filterA: function(value){
                    return value.split(' ').join('')
                },
                filterB: function(value){
                    return parseFloat(value).toFixed(2) + '元'
                }
            }
        })

    </script>
</body>
</html>